package com.sduept.nwld.dataserver.manager.protection;

import com.sduept.core.dao.SuperDAO;
import com.sduept.nwld.dataserver.model.daily.MainProtectQuit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class OperationRiskOutManager {
	@Autowired
	SuperDAO dao;

	public List<MainProtectQuit> findAll() {
		return dao.findAll(MainProtectQuit.class);
	}

	public void updateRiskExceed(MainProtectQuit select) {
		dao.update(select, MainProtectQuit.class);
	}

	public List<MainProtectQuit> findByTime(Date start, Date end) {
		return dao.findByCondition(MainProtectQuit.class,
				" executionTime between ? and ? order by executionTime desc", start, end);
	}
	
	public MainProtectQuit creat(MainProtectQuit created){
		return dao.create(created, MainProtectQuit.class);
	}
	
	public MainProtectQuit update(MainProtectQuit selected){
		return dao.update(selected, MainProtectQuit.class);
	}
	
	public void delete( String id){
		dao.delete(id, MainProtectQuit.class);
	}
}
